
<%@ page import="forum.Antwort" %>
<!DOCTYPE html>
<html>
	<head>
		<meta name="layout" content="main">
		<g:set var="entityName" value="${message(code: 'antwort.label', default: 'Antwort')}" />
		<title><g:message code="default.list.label" args="[entityName]" /></title>
	</head>
	<body>
	<sec:ifLoggedIn>
<%--		<a href="#list-antwort" class="skip" tabindex="-1"><g:message code="default.link.skip.label" default="Skip to content&hellip;"/></a>--%>
<%--		<div class="nav" role="navigation">--%>
<%--			<ul>--%>
<%--				<li><a class="home" href="${createLink(uri: '/')}"><g:message code="default.home.label"/></a></li>--%>
<%--				<li><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></li>--%>
<%--			</ul>--%>
<%--		</div>--%>
		<div id="create-antwort" class="content scaffold-create" role="main">
			<h1><g:message code="default.create.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<g:hasErrors bean="${antwortInstance}">
			<ul class="errors" role="alert">
				<g:eachError bean="${antwortInstance}" var="error">
				<li <g:if test="${error in org.springframework.validation.FieldError}">data-field-id="${error.field}"</g:if>><g:message error="${error}"/></li>
				</g:eachError>
			</ul>
			</g:hasErrors>
			<g:form action="save" >
				<fieldset class="form">
<%--					<g:render template="form"/>--%>
<div class="fieldcontain ${hasErrors(bean: antwortInstance, field: 'antwort', 'error')} ">
	<label for="antwort">
		<g:message code="antwort.antwort.label" default="Antwort" />
		
	</label>
	<g:textArea name="antwort" value="${antwortInstance?.antwort}"/>
</div>

<div class="fieldcontain ${hasErrors(bean: antwortInstance, field: 'benutzer', 'error')} required">
	<label for="benutzer" style="visibility: hidden;">
		<g:message code="antwort.benutzer.label" default="Benutzer" />
		<span class="required-indicator">*</span>
	</label>
	<g:select id="benutzer" name="benutzer.id" from="${forum.Benutzer.list()}" optionKey="id" required="" value="${antwortInstance?.benutzer?.id}" class="many-to-one" style="visibility: hidden;"/>
</div>

<div class="fieldcontain ${hasErrors(bean: antwortInstance, field: 'frage', 'error')} required">
	<label for="frage" style="visibility: hidden;">
		<g:message code="antwort.frage.label" default="Frage" />
		<span class="required-indicator">*</span>
	</label>
<%--	<g:select id="frage" name="frage.id" from="${forum.Frage.list()}" optionKey="id" required="" value="${antwortInstance?.frage?.id}" class="many-to-one"/>--%>
	<g:hiddenField name="frage.id" value="${frageId }"/>
</div>
				</fieldset>
				<fieldset class="buttons">
					<g:submitButton name="create" class="save" value="${message(code: 'default.button.create.label', default: 'Create')}" />
				</fieldset>
			</g:form>
		</div>
		</sec:ifLoggedIn>
		
		<div id="list-antwort" class="content scaffold-list" role="main">
			<h1><g:message code="default.list.label" args="[entityName]" /></h1>
			<g:if test="${flash.message}">
			<div class="message" role="status">${flash.message}</div>
			</g:if>
			<table>
				<thead>
					<tr>
					
						<g:sortableColumn property="antwort" title="${message(code: 'antwort.antwort.label', default: 'Antwort')}" />
					
						<th><g:message code="antwort.benutzer.label" default="Benutzer" /></th>
					
						<g:sortableColumn property="dateCreated" title="${message(code: 'antwort.dateCreated.label', default: 'Date Created')}" />
					
						<th><g:message code="antwort.frage.label" default="Frage" /></th>
					
					</tr>
				</thead>
				<tbody>
				<g:each in="${antwortInstanceList}" status="i" var="antwortInstance">
					<tr class="${(i % 2) == 0 ? 'even' : 'odd'}">
					
						<td><g:link action="show" id="${antwortInstance.id}">${fieldValue(bean: antwortInstance, field: "antwort")}</g:link></td>
					
						<td>${fieldValue(bean: antwortInstance, field: "benutzer")}</td>
					
						<td><g:formatDate date="${antwortInstance.dateCreated}" /></td>
					
						<td>${fieldValue(bean: antwortInstance, field: "frage")}</td>
					
					</tr>
				</g:each>
				</tbody>
			</table>
			<div class="pagination">
				<g:paginate total="${antwortInstanceTotal}" />
			</div>
		</div>
	</body>
</html>
